package cfh.spring.data.jpademo.model;

/**
 * 咖啡实体类
 *
 * @author chenfh
 * date 2019/7/30
 */

import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Type;
import org.joda.money.Money;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 咖啡实体类
 */
@Entity
@Table(name = "T_COFFEE")
@Data
@Builder
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class Coffee extends BaseEntity {

    private String name;

    @Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyMinorAmount",
            parameters = {@org.hibernate.annotations.Parameter(name = "currencyCode", value = "CNY")})
    private Money price;

}
